package com.hgy.fxui.service.impl;

import com.hgy.fxui.dao.UserDao;
import com.hgy.fxui.model.User;
import com.hgy.fxui.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User authenticateUser(String username, String password) {
        User user = userDao.findByUsername(username);
        if (user != null && password.equals(user.getPassword())) {
            return user;
        }
        return null;
    }
}
